﻿@using HopNguyenCms.Infrastructure
@using HopNguyenModel
@{
    var db = new HopNguyenEntities();
    var latest = db.Database.SqlQuery<Content>("Select top 16 * from Content where GroupId = 2 order by DownloadDate desc");
    var most = db.Database.SqlQuery<Content>("Select top 16 * from Content where GroupId = 2 order by Download desc");
    var view = db.Database.SqlQuery<Content>("Select top 16 * from Content where GroupId = 2 order by Hit desc");
    var i = 0;
    var j = 0;
    var k = 0;
}

<div class="tabs-download">
    <ul class="tabs-list">
        <li><a href='#Latest'>Latest Downloads</a></li>
        <li><a href='#Most'>Most Downloads</a></li>
        <li><a href='#View'>Most View</a></li>
    </ul>
    <div class="tabs-content">
        <div id='Latest' class="tab-detail">
            <div class="row-fluid video-item">
                @foreach (var item in latest)
                {
                    <div class="span3">
                        <div class="video-image">
                            <a href="@AppSettings.CurrentDomain@item.UrlVideo" title="@Html.Raw(item.Name)">
                                <img src="http://i3.ytimg.com/vi/@item.Alias/mqdefault.jpg" alt="@Html.Raw(item.Name)"/>

                                <div class="duaration">@item.Summary</div>
                                <div class="play">
                                    <img src="/frontend/img/play.png" alt="play video" />
                                </div>
                            </a>
                        </div>
                        <h5><a href="@AppSettings.CurrentDomain@item.UrlVideo" title="@Html.Raw(item.Name)">@Html.Raw(item.Name)</a></h5>
                    </div>
                    i++;
                    if (i % 4 == 0)
                    {
                    @Html.Raw("</div><div class=\"row-fluid video-item\">")
                    }
                }
            </div>
        </div>
        <div id='Most' class="tab-detail">
            <div class="row-fluid video-item">
                @foreach (var item in most)
                {
                    <div class="span3">
                        <div class="video-image">
                            <a href="@AppSettings.CurrentDomain@item.UrlVideo" title="@Html.Raw(item.Name)">
                                <img src="http://i3.ytimg.com/vi/@item.Alias/mqdefault.jpg" alt="@Html.Raw(item.Name)"/>

                                <div class="duaration">@item.Summary</div>
                                <div class="play">
                                    <img src="/frontend/img/play.png" alt="play video" />
                                </div>
                            </a>
                        </div>
                        <h5><a href="@AppSettings.CurrentDomain@item.UrlVideo" title="@Html.Raw(item.Name)">@Html.Raw(item.Name)</a></h5>
                    </div>
                    j++;
                    if (j % 4 == 0)
                    {
                    @Html.Raw("</div><div class=\"row-fluid video-item\">")
                    }
                }
            </div>
        </div>
        <div id='View' class="tab-detail">
            <div class="row-fluid video-item">
                @foreach (var item in view)
                {
                    <div class="span3">
                        <div class="video-image">
                            <a href="@AppSettings.CurrentDomain@item.UrlVideo" title="@Html.Raw(item.Name)">
                                <img src="http://i3.ytimg.com/vi/@item.Alias/mqdefault.jpg" alt="@Html.Raw(item.Name)"/>

                                <div class="duaration">@item.Summary</div>
                                <div class="play">
                                    <img src="/frontend/img/play.png" alt="play video" />
                                </div>
                            </a>
                        </div>
                        <h5><a href="@AppSettings.CurrentDomain@item.UrlVideo" title="@Html.Raw(item.Name)">@Html.Raw(item.Name)</a></h5>
                    </div>
                    k++;
                    if (k % 4 == 0)
                    {
                    @Html.Raw("</div><div class=\"row-fluid video-item\">")
                    }
                }
            </div>
        </div>
    </div>
</div>
